function [ index ] = Vmap( i,j )
% Returns index on Velocity y matrix for 1:2 expansion problem
% Inputs:
% i: index denotes spacial X position
% j: index denotes Y spatial position
%

global NIt
global NJt
global NIe
global NJe

NIvt = NIt;
NJvt = NJt+1;
NIve = NIe;
NJve = NJe+1;


if ( j <= (NJve) )
    % Located below expansion
    index = i + (j-1) * NIvt;
else
    % Located above expansion
    block1 = NIvt*(NJve);
    is = i-NIve;
    js = j-NJve;
    index = block1 + is + (NIvt-NIve) * (js-1);
    if (is<1 || js<1)
        error = 'OUT OF BOUNDS VIJ'
    end
end




end

